﻿using System;

namespace SuperX.SuperSocket.Socket.Transfer.Client.UpLoad
{
    internal class FileUploadingEvents : IFileUploadingEvents
    {
        internal TransferEventHandler<TransferStartEventArgs> OnTransferStart;

        internal BTransferEventHandler<EventArgs> OnFileExist;

        internal TransferEventHandler<EventArgs> OnFileClose;

        internal TransferEventHandler<EventArgs> OnTransferComplete;

        internal TransferEventHandler<EventArgs> OnServerTransferComplete;

        internal TransferEventHandler<TransferErrorEventArgs> OnTransferError;

        internal TransferEventHandler<TransferStepEventArgs> OnTransferStep;

        internal TransferEventHandler<TransferFileExistUplodingEventArgs> OnTransferExistUploading;

        public event TransferEventHandler<TransferStartEventArgs> TransferStart
        {
            add { OnTransferStart = (TransferEventHandler<TransferStartEventArgs>)Delegate.Combine(OnTransferStart, value); }
            remove { OnTransferStart = (TransferEventHandler<TransferStartEventArgs>)Delegate.Remove(OnTransferStart, value); }
        }

        public event BTransferEventHandler<EventArgs> FileExist
        {
            add { OnFileExist = (BTransferEventHandler<EventArgs>)Delegate.Combine(OnFileExist, value); }
            remove { OnFileExist = (BTransferEventHandler<EventArgs>)Delegate.Remove(OnFileExist, value); }
        }

        public event TransferEventHandler<EventArgs> FileClose
        {
            add { OnFileClose = (TransferEventHandler<EventArgs>)Delegate.Combine(OnFileClose, value); }
            remove { OnFileClose = (TransferEventHandler<EventArgs>)Delegate.Remove(OnFileClose, value); }
        }

        public event TransferEventHandler<EventArgs> TransferComplete
        {
            add { OnTransferComplete = (TransferEventHandler<EventArgs>)Delegate.Combine(OnTransferComplete, value); }
            remove { OnTransferComplete = (TransferEventHandler<EventArgs>)Delegate.Remove(OnTransferComplete, value); }
        }

        public event TransferEventHandler<EventArgs> ServerTransferComplete
        {
            add { OnServerTransferComplete = (TransferEventHandler<EventArgs>)Delegate.Combine(OnServerTransferComplete, value); }
            remove { OnServerTransferComplete = (TransferEventHandler<EventArgs>)Delegate.Remove(OnServerTransferComplete, value); }
        }

        public event TransferEventHandler<TransferErrorEventArgs> TransferError
        {
            add { OnTransferError = (TransferEventHandler<TransferErrorEventArgs>)Delegate.Combine(OnTransferError, value); }
            remove { OnTransferError = (TransferEventHandler<TransferErrorEventArgs>)Delegate.Remove(OnTransferError, value); }
        }

        public event TransferEventHandler<TransferStepEventArgs> TransferStep
        {
            add { OnTransferStep = (TransferEventHandler<TransferStepEventArgs>)Delegate.Combine(OnTransferStep, value); }
            remove { OnTransferStep = (TransferEventHandler<TransferStepEventArgs>)Delegate.Remove(OnTransferStep, value); }
        }

        public event TransferEventHandler<TransferFileExistUplodingEventArgs> TransferFileExistUploding
        {
            add { OnTransferExistUploading = (TransferEventHandler<TransferFileExistUplodingEventArgs>)Delegate.Combine(OnTransferExistUploading, value); }
            remove { OnTransferExistUploading = (TransferEventHandler<TransferFileExistUplodingEventArgs>)Delegate.Remove(OnTransferExistUploading, value); }
        }
    }
}